package swing_UI;



import javax.swing.ImageIcon;
import javax.swing.JButton;

public class ClientButton extends JButton {

	/**
	 * 
	 */
	
	
	
	private static final long serialVersionUID = 1L;
	public Client.Status status;
	
	public ClientButton(String btn_text)
	{
		super(btn_text);
		
		this.status = Client.Status.DISCONNECTED;
	}
	
	public void setStatus(Client.Status status)
	{
		this.status = status;
		switch(status)
		{
			case CONNECTED:
				this.setIcon(new ImageIcon("trunk/res/computer_connected.jpg"));
				this.setToolTipText("Connected for 1:10:56, $5.23. Click for details");
				break;
			case DISCONNECTED:
				this.setIcon(new ImageIcon("trunk/res/computer_disconnected.jpg"));
				this.setToolTipText("Disconnected, click to connect");
				break;
			case ERROR:
				this.setIcon(new ImageIcon("trunk/res/computer_error.jpg"));
				this.setToolTipText("Error, click for details");
				break;
		}
	}
	public Client.Status getStatus()
	{
		return this.status;
		
	}
	
	
}
